/*
# ------------------------------------------------------------------------
# JD Base Theme
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/
var sp_timeout = null;
$(document).ready(function() {
	$('.sublevel ul li').each(function() {
		$(this).bind('mouseenter', function() {
			clearTimeout(sp_timeout);
			
			if(!$(this).parent().parent().hasClass('haschild')){
				$('.hover').removeClass('hover');
			}
			if ($(this).hasClass('haschild')) {
				$(this).addClass('hover');
			}
		}).bind('mouseleave', function() {
			if ($(this).hasClass('haschild')) {
				sp_timeout = setTimeout("$('.hover').removeClass('hover')",1000);
				//$(this).removeClass('hover');
			}
		});
	});
});